// -----------------------------
// Author: 		Dhaenens Gert 
// Creation: 	9/16/2014 2:53:27 AM				
// -----------------------------

#ifndef _LuaClassRegister_h
#define _LuaClassRegister_h

#include "Lua.h"
#include "LuaTable.h"

namespace ObjectLua
{

	class LuaTable;
	template<typename T>
	class LuaClass;

	template<typename T>
	class LuaClassRegister
	{
	public:
		friend class LuaClass<T>;

		/*
		//	Is this class registered?
		*/
		static bool			isRegistered();
		/*
		//	Get the meta table
		*/
		static LuaTable*	getMetaTable();
		/*
		//	Get the meta table name
		*/
		static const char*	getMetaTableName();

	private:

		static bool			s_IsRegistered;
		static LuaTable*	s_MetaTable;
		static const int	MaxNameLength = 64;
		static char			s_MetaTableName[MaxNameLength];

		LuaClassRegister();
		LuaClassRegister(const LuaClassRegister& refLuaClassRegister);
		LuaClassRegister& operator=(const LuaClassRegister& refLuaClassRegister);
		~LuaClassRegister();
	};

}

#include "LuaClassRegister.inl"
#endif